A large number of devices equipped with a wireless function including an IEEE (Institute of Electrical and Electronics Engineers) 802.11 wireless LAN have been registered and manufactured in recent years.
An example of a communication method based upon the IEEE 802.11 wireless LAN is the ad-hoc mode, in which terminals communicate with each other directly. This is in addition to the infrastructure mode, in which communication is performed via access points.
In the ad-hoc mode of an IEEE 802.11 wireless LAN, a terminal attempting to establish a network transmits a notification signal, which is referred to as a beacon, thereby establishing the network. A terminal that is to participate in the network does so and communicates based upon information (beacon period, transmission rate, etc.) contained in the beacon.
Between terminals that construct the network, the communication channel and wireless communication parameters such as the network identifier, encryption methods and encryption key must be set to common values. In an IEEE 802.11 wireless LAN, there are two types of network identifiers, namely SSID (Service Set Identification) and BSSID (Basic Service Set Identification) [see the specification of U.S. Patent Laid-Open No. 2005/250487 (Japanese Patent Application Laid-Open No. 2005-323116)].
The SSID is an identifier that can be set to any value by the user and that is also capable of being set in a terminal in advance. On the other hand, the BSSID is an identifier generated by a terminal that establishes an ad-hoc network, namely a terminal that transmits a beacon first, based upon the terminal's own MAC (Media Access Control) address, etc. In a case where terminals communicate via the same wireless communication, these two network identifiers must be set to a common value between the terminals.
For example, in order to perform wireless communication in the ad-hoc mode, assume that a common SSID is set between two terminals in advance. In order for one of these terminals to establish an ad-hoc network, the terminal generates the BSSID and starts to transmit a beacon. When this is done, the other terminal sets itself to this BSSID, thereby making it possible to communicate in the ad-hoc mode.
However, there is the possibility that when both terminals attempt to establish an ad-hoc network substantially simultaneously, each terminal will generate a respective BSSID and start transmitting a beacon, thereby constructing separate ad-hoc networks. In such case the two terminals will not be able to communicate wirelessly with each other regardless of the fact that the same SSID has been set.